package com.gopay.common.domain.aggregatepayment;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * @author Chenyu Li
 * @description 聚合支付商户入驻表
 * @date 2017/12/29
 * Copyright (c) 2017. www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "AP_CUST_INFO")
public class ApCustInfo extends BaseEntity {
    private String traId;
    private String custId;
    private String interChannel;
    private String mctNo;
    private String merChantName;
    private String merShortName;
    private String email;
    private Date auditTime;
    private Date regTime;
    private String custMobile;
    private String corpTel;
    private String gopayMccProvince;
    private String gopayMccCity;
    private String corpCountryCode;
    private String corpAddr;
    private String cityId;
    private String businessLicenseNo;
    private Date businessTerm;
    private String organizationCode;
    private String apBusinessUrl;
    private String legalPersonName;
    private String legalPersonGender;
    private String legalPersonCertType;
    private String legalPersonCertNo;
    private Date legalPersonCertTerm;
    private String legalPersonMob;
    private String apLegalPersonCertFrontUrl;
    private String apLegalPersonCertBackUrl;
    private String status;
    private Date createdTs;
    private Date lastUpdateTs;
    private int version;
    private String apBusinessThumbUrl;
    private String apCertFontThumbUrl;
    private String apCertBackThumbUrl;
    private String lastUpdOperId;
    private String clsId;
    private String blPic;
    private String bossPositive;
    private String bossBack;

    @Id
    @Column(name = "TRA_ID", nullable = false, length = 12)
    public String getTraId() {
        return traId;
    }

    public void setTraId(String traId) {
        this.traId = traId;
    }

    @Basic
    @Column(name = "CUST_ID", nullable = true, length = 10)
    public String getCustId() {
        return custId;
    }

    public void setCustId(String custId) {
        this.custId = custId;
    }

    @Basic
    @Column(name = "INTER_CHANNEL", nullable = true, length = 2)
    public String getInterChannel() {
        return interChannel;
    }

    public void setInterChannel(String interChannel) {
        this.interChannel = interChannel;
    }

    @Basic
    @Column(name = "MCT_NO", nullable = true, length = 20)
    public String getMctNo() {
        return mctNo;
    }

    public void setMctNo(String mctNo) {
        this.mctNo = mctNo;
    }

    @Basic
    @Column(name = "MER_CHANT_NAME", nullable = true, length = 100)
    public String getMerChantName() {
        return merChantName;
    }

    public void setMerChantName(String merChantName) {
        this.merChantName = merChantName;
    }

    @Basic
    @Column(name = "MER_SHORT_NAME", nullable = true, length = 100)
    public String getMerShortName() {
        return merShortName;
    }

    public void setMerShortName(String merShortName) {
        this.merShortName = merShortName;
    }

    @Basic
    @Column(name = "EMAIL", nullable = true, length = 100)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "AUDIT_TIME", nullable = true)
    public Date getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(Date auditTime) {
        this.auditTime = auditTime;
    }

    @Basic
    @Column(name = "REG_TIME", nullable = true)
    public Date getRegTime() {
        return regTime;
    }

    public void setRegTime(Date regTime) {
        this.regTime = regTime;
    }

    @Basic
    @Column(name = "CUST_MOBILE", nullable = true, length = 11)
    public String getCustMobile() {
        this.custMobile = SensitiveInfoUtils.autoReencrypt(this.custMobile);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.custMobile);
    }

    public void setCustMobile(String custMobile) {
        this.custMobile = SensitiveInfoUtils.smartEncryptWithCheck(custMobile);
    }

    @Basic
    @Column(name = "CORP_TEL", nullable = true, length = 15)
    public String getCorpTel() {
        return corpTel;
    }

    public void setCorpTel(String corpTel) {
        this.corpTel = corpTel;
    }


    @Basic
    @Column(name = "GOPAY_MCC_PROVINCE", nullable = true, length = 20)
    public String getGopayMccProvince() {
        return gopayMccProvince;
    }

    public void setGopayMccProvince(String gopayMccProvince) {
        this.gopayMccProvince = gopayMccProvince;
    }

    @Basic
    @Column(name = "GOPAY_MCC_CITY", nullable = true, length = 20)
    public String getGopayMccCity() {
        return gopayMccCity;
    }

    public void setGopayMccCity(String gopayMccCity) {
        this.gopayMccCity = gopayMccCity;
    }

    @Basic
    @Column(name = "CORP_COUNTRY_CODE", nullable = true, length = 20)
    public String getCorpCountryCode() {
        return corpCountryCode;
    }

    public void setCorpCountryCode(String corpCountryCode) {
        this.corpCountryCode = corpCountryCode;
    }

    @Basic
    @Column(name = "CORP_ADDR", nullable = true, length = 200)
    public String getCorpAddr() {
        return corpAddr;
    }

    public void setCorpAddr(String corpAddr) {
        this.corpAddr = corpAddr;
    }

    @Basic
    @Column(name = "CITY_ID", nullable = true, length = 6)
    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    @Basic
    @Column(name = "BUSINESS_LICENSE_NO", nullable = true, length = 50)
    public String getBusinessLicenseNo() {
        return businessLicenseNo;
    }

    public void setBusinessLicenseNo(String businessLicenseNo) {
        this.businessLicenseNo = businessLicenseNo;
    }

    @Basic
    @Column(name = "BUSINESS_TERM", nullable = true)
    public Date getBusinessTerm() {
        return businessTerm;
    }

    public void setBusinessTerm(Date businessTerm) {
        this.businessTerm = businessTerm;
    }

    @Basic
    @Column(name = "ORGANIZATION_CODE", nullable = true, length = 30)
    public String getOrganizationCode() {
        return organizationCode;
    }

    public void setOrganizationCode(String organizationCode) {
        this.organizationCode = organizationCode;
    }

    @Basic
    @Column(name = "AP_BUSINESS_URL", nullable = true, length = 200)
    public String getApBusinessUrl() {
        return apBusinessUrl;
    }

    public void setApBusinessUrl(String apBusinessUrl) {
        this.apBusinessUrl = apBusinessUrl;
    }

    @Basic
    @Column(name = "LEGAL_PERSON_NAME", nullable = true, length = 30)
    public String getLegalPersonName() {
        return legalPersonName;
    }

    public void setLegalPersonName(String legalPersonName) {
        this.legalPersonName = legalPersonName;
    }

    @Basic
    @Column(name = "LEGAL_PERSON_GENDER", nullable = true, length = 1)
    public String getLegalPersonGender() {
        return legalPersonGender;
    }

    public void setLegalPersonGender(String legalPersonGender) {
        this.legalPersonGender = legalPersonGender;
    }

    @Basic
    @Column(name = "LEGAL_PERSON_CERT_TYPE", nullable = true, length = 2)
    public String getLegalPersonCertType() {
        return legalPersonCertType;
    }

    public void setLegalPersonCertType(String legalPersonCertType) {
        this.legalPersonCertType = legalPersonCertType;
    }

    @Basic
    @Column(name = "LEGAL_PERSON_CERT_NO", nullable = true, length = 150)
    public String getLegalPersonCertNo() {
        this.legalPersonCertNo = SensitiveInfoUtils.autoReencrypt(this.legalPersonCertNo);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.legalPersonCertNo);
    }

    public void setLegalPersonCertNo(String legalPersonCertNo) {
        this.legalPersonCertNo = SensitiveInfoUtils.smartEncryptWithCheck(legalPersonCertNo);
    }

    @Basic
    @Column(name = "LEGAL_PERSON_CERT_TERM", nullable = true)
    public Date getLegalPersonCertTerm() {
        return legalPersonCertTerm;
    }

    public void setLegalPersonCertTerm(Date legalPersonCertTerm) {
        this.legalPersonCertTerm = legalPersonCertTerm;
    }

    @Basic
    @Column(name = "LEGAL_PERSON_MOB", nullable = true, length = 100)
    public String getLegalPersonMob() {
        this.legalPersonMob = SensitiveInfoUtils.autoReencrypt(this.legalPersonMob);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.legalPersonMob);
    }

    public void setLegalPersonMob(String legalPersonMob) {
        this.legalPersonMob = SensitiveInfoUtils.smartEncryptWithCheck(legalPersonMob);
    }

    @Basic
    @Column(name = "AP_LEGAL_PERSON_CERT_FRONT_URL", nullable = true, length = 100)
    public String getApLegalPersonCertFrontUrl() {
        return apLegalPersonCertFrontUrl;
    }

    public void setApLegalPersonCertFrontUrl(String apLegalPersonCertFrontUrl) {
        this.apLegalPersonCertFrontUrl = apLegalPersonCertFrontUrl;
    }

    @Basic
    @Column(name = "AP_LEGAL_PERSON_CERT_BACK_URL", nullable = true, length = 100)
    public String getApLegalPersonCertBackUrl() {
        return apLegalPersonCertBackUrl;
    }

    public void setApLegalPersonCertBackUrl(String apLegalPersonCertBackUrl) {
        this.apLegalPersonCertBackUrl = apLegalPersonCertBackUrl;
    }

    @Basic
    @Column(name = "STATUS", nullable = true, length = 1)
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Basic
    @Column(name = "CREATED_TS", nullable = false)
    public Date getCreatedTs() {
        return createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Basic
    @Column(name = "LAST_UPDATE_TS", nullable = false)
    public Date getLastUpdateTs() {
        return lastUpdateTs;
    }

    public void setLastUpdateTs(Date lastUpdateTs) {
        this.lastUpdateTs = lastUpdateTs;
    }

    @Basic
    @Column(name = "VERSION", nullable = false, precision = 0)
    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Basic
    @Column(name = "AP_BUSINESS_THUMB_URL", nullable = true, length = 200)
    public String getApBusinessThumbUrl() {
        return apBusinessThumbUrl;
    }

    public void setApBusinessThumbUrl(String apBusinessThumbUrl) {
        this.apBusinessThumbUrl = apBusinessThumbUrl;
    }


    @Basic
    @Column(name = "AP_CERT_FRONT_THUMB_URL", nullable = true, length = 200)
    public String getApCertFontThumbUrl() {
        return apCertFontThumbUrl;
    }

    public void setApCertFontThumbUrl(String apCertFontThumbUrl) {
        this.apCertFontThumbUrl = apCertFontThumbUrl;
    }

    @Basic
    @Column(name = "AP_CERT_BACK_THUMB_URL", nullable = true, length = 200)
    public String getApCertBackThumbUrl() {
        return apCertBackThumbUrl;
    }

    public void setApCertBackThumbUrl(String apCertBackThumbUrl) {
        this.apCertBackThumbUrl = apCertBackThumbUrl;
    }

    @Basic
    @Column(name = "LAST_UPD_OPER_ID", nullable = true, length = 10)
    public String getLastUpdOperId() {
        return lastUpdOperId;
    }

    public void setLastUpdOperId(String lastUpdOperId) {
        this.lastUpdOperId = lastUpdOperId;
    }

    @Basic
    @Column(name = "CLS_ID", nullable = true, length = 100)
    public String getClsId() {
        return clsId;
    }

    public void setClsId(String clsId) {
        this.clsId = clsId;
    }

    @Basic
    @Column(name = "BL_PIC", nullable = true, length = 200)
    public String getBlPic() {
        return blPic;
    }

    public void setBlPic(String blPic) {
        this.blPic = blPic;
    }

    @Basic
    @Column(name = "BOSS_POSITIVE", nullable = true, length = 200)
    public String getBossPositive() {
        return bossPositive;
    }

    public void setBossPositive(String bossPositive) {
        this.bossPositive = bossPositive;
    }

    @Basic
    @Column(name = "BOSS_BACK", nullable = true, length = 200)
    public String getBossBack() {
        return bossBack;
    }

    public void setBossBack(String bossBack) {
        this.bossBack = bossBack;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        ApCustInfo that = (ApCustInfo) o;

        if (version != that.version) {
            return false;
        }
        if (traId != null ? !traId.equals(that.traId) : that.traId != null) {
            return false;
        }
        if (custId != null ? !custId.equals(that.custId) : that.custId != null) {
            return false;
        }
        if (interChannel != null ? !interChannel.equals(that.interChannel) : that.interChannel != null) {
            return false;
        }
        if (mctNo != null ? !mctNo.equals(that.mctNo) : that.mctNo != null) {
            return false;
        }
        if (merChantName != null ? !merChantName.equals(that.merChantName) : that.merChantName != null) {
            return false;
        }
        if (merShortName != null ? !merShortName.equals(that.merShortName) : that.merShortName != null) {
            return false;
        }
        if (email != null ? !email.equals(that.email) : that.email != null) {
            return false;
        }
        if (auditTime != null ? !auditTime.equals(that.auditTime) : that.auditTime != null) {
            return false;
        }
        if (regTime != null ? !regTime.equals(that.regTime) : that.regTime != null) {
            return false;
        }
        if (custMobile != null ? !custMobile.equals(that.custMobile) : that.custMobile != null) {
            return false;
        }
        if (corpTel != null ? !corpTel.equals(that.corpTel) : that.corpTel != null) {
            return false;
        }
        if (gopayMccProvince != null ? !gopayMccProvince.equals(that.gopayMccProvince) : that.gopayMccProvince != null) {
            return false;
        }
        if (gopayMccCity != null ? !gopayMccCity.equals(that.gopayMccCity) : that.gopayMccCity != null) {
            return false;
        }
        if (corpCountryCode != null ? !corpCountryCode.equals(that.corpCountryCode) : that.corpCountryCode != null) {
            return false;
        }
        if (corpAddr != null ? !corpAddr.equals(that.corpAddr) : that.corpAddr != null) {
            return false;
        }
        if (cityId != null ? !cityId.equals(that.cityId) : that.cityId != null) {
            return false;
        }
        if (businessLicenseNo != null ? !businessLicenseNo.equals(that.businessLicenseNo) : that.businessLicenseNo != null) {
            return false;
        }
        if (businessTerm != null ? !businessTerm.equals(that.businessTerm) : that.businessTerm != null) {
            return false;
        }
        if (organizationCode != null ? !organizationCode.equals(that.organizationCode) : that.organizationCode != null) {
            return false;
        }
        if (apBusinessUrl != null ? !apBusinessUrl.equals(that.apBusinessUrl) : that.apBusinessUrl != null) {
            return false;
        }
        if (legalPersonName != null ? !legalPersonName.equals(that.legalPersonName) : that.legalPersonName != null) {
            return false;
        }
        if (legalPersonGender != null ? !legalPersonGender.equals(that.legalPersonGender) : that.legalPersonGender != null) {
            return false;
        }
        if (legalPersonCertType != null ? !legalPersonCertType.equals(that.legalPersonCertType) : that.legalPersonCertType != null) {
            return false;
        }
        if (legalPersonCertNo != null ? !legalPersonCertNo.equals(that.legalPersonCertNo) : that.legalPersonCertNo != null) {
            return false;
        }
        if (legalPersonCertTerm != null ? !legalPersonCertTerm.equals(that.legalPersonCertTerm) : that.legalPersonCertTerm != null) {
            return false;
        }
        if (legalPersonMob != null ? !legalPersonMob.equals(that.legalPersonMob) : that.legalPersonMob != null) {
            return false;
        }
        if (apLegalPersonCertFrontUrl != null ? !apLegalPersonCertFrontUrl.equals(that.apLegalPersonCertFrontUrl) : that.apLegalPersonCertFrontUrl != null) {
            return false;
        }
        if (apLegalPersonCertBackUrl != null ? !apLegalPersonCertBackUrl.equals(that.apLegalPersonCertBackUrl) : that.apLegalPersonCertBackUrl != null) {
            return false;
        }
        if (status != null ? !status.equals(that.status) : that.status != null) {
            return false;
        }
        if (createdTs != null ? !createdTs.equals(that.createdTs) : that.createdTs != null) {
            return false;
        }
        if (lastUpdateTs != null ? !lastUpdateTs.equals(that.lastUpdateTs) : that.lastUpdateTs != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = traId != null ? traId.hashCode() : 0;
        result = 31 * result + (custId != null ? custId.hashCode() : 0);
        result = 31 * result + (interChannel != null ? interChannel.hashCode() : 0);
        result = 31 * result + (mctNo != null ? mctNo.hashCode() : 0);
        result = 31 * result + (merChantName != null ? merChantName.hashCode() : 0);
        result = 31 * result + (merShortName != null ? merShortName.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (auditTime != null ? auditTime.hashCode() : 0);
        result = 31 * result + (regTime != null ? regTime.hashCode() : 0);
        result = 31 * result + (custMobile != null ? custMobile.hashCode() : 0);
        result = 31 * result + (corpTel != null ? corpTel.hashCode() : 0);
        result = 31 * result + (gopayMccProvince != null ? gopayMccProvince.hashCode() : 0);
        result = 31 * result + (gopayMccCity != null ? gopayMccCity.hashCode() : 0);
        result = 31 * result + (corpCountryCode != null ? corpCountryCode.hashCode() : 0);
        result = 31 * result + (corpAddr != null ? corpAddr.hashCode() : 0);
        result = 31 * result + (cityId != null ? cityId.hashCode() : 0);
        result = 31 * result + (businessLicenseNo != null ? businessLicenseNo.hashCode() : 0);
        result = 31 * result + (businessTerm != null ? businessTerm.hashCode() : 0);
        result = 31 * result + (organizationCode != null ? organizationCode.hashCode() : 0);
        result = 31 * result + (apBusinessUrl != null ? apBusinessUrl.hashCode() : 0);
        result = 31 * result + (legalPersonName != null ? legalPersonName.hashCode() : 0);
        result = 31 * result + (legalPersonGender != null ? legalPersonGender.hashCode() : 0);
        result = 31 * result + (legalPersonCertType != null ? legalPersonCertType.hashCode() : 0);
        result = 31 * result + (legalPersonCertNo != null ? legalPersonCertNo.hashCode() : 0);
        result = 31 * result + (legalPersonCertTerm != null ? legalPersonCertTerm.hashCode() : 0);
        result = 31 * result + (legalPersonMob != null ? legalPersonMob.hashCode() : 0);
        result = 31 * result + (apLegalPersonCertFrontUrl != null ? apLegalPersonCertFrontUrl.hashCode() : 0);
        result = 31 * result + (apLegalPersonCertBackUrl != null ? apLegalPersonCertBackUrl.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (createdTs != null ? createdTs.hashCode() : 0);
        result = 31 * result + (lastUpdateTs != null ? lastUpdateTs.hashCode() : 0);
        result = 31 * result + version;
        return result;
    }
}
